package ynu.csy.elm_springboot3.config;

// OpenApiConfig是一个配置类，用于配置SpringDoc的OpenAPI
// SpringDoc是一个用于生成OpenAPI的工具
// 通过SpringDoc，可以根据Spring Boot项目中的API自动生成OpenAPI文档
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
import io.swagger.v3.oas.annotations.security.SecurityScheme;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfig {
    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI().info(new Info()
                .title("饿了么管理系统API").version("1.0")
                .contact(new Contact().name("程思宇"))
                .description("软件工程实现-中级-饿了么api文档"));
    }
    @Bean
    public GroupedOpenApi elmApi() {
        return GroupedOpenApi.builder()
                .group("API管理-elm系统")
                .packagesToScan("ynu.csy.elm_springboot3.controller")
//                  .addOpenApiCustomiser(jwtHeaderOpenApiCustomiser())
                .build();

    }
}